﻿using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using TreeViewWithViewModelDemo.FolderTree.DataModel;

namespace TreeViewWithViewModelDemo.FolderTree.ViewModel
{
    public class FolderTreeVIewModel
    {
        readonly ReadOnlyCollection<FolderNodeVIewModel> _firstGeneration;
        readonly FolderNodeVIewModel _rootNode;

        public FolderTreeVIewModel(MyFolder rootFolder)
        {
            _rootNode = new FolderNodeVIewModel(rootFolder);
            _rootNode.IsExpanded = true;

            _firstGeneration = new ReadOnlyCollection<FolderNodeVIewModel>(
                new FolderNodeVIewModel[] 
                { 
                    _rootNode 
                }); 
             
        }

        public ReadOnlyCollection<FolderNodeVIewModel> FirstGeneration
        {
            get { return _firstGeneration; }
        }
    }
}

